<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>chigraph: lib/core/src/GraphStruct.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="chigraphDoxygenIcon.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">chigraph
   &#160;<span id="projectnumber">master</span>
   </div>
   <div id="projectbrief">Systems programming language written for beginners in LLVM</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('GraphStruct_8cpp_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">GraphStruct.cpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="GraphStruct_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="GraphStruct_8hpp.html">chi/GraphStruct.hpp</a>&quot;</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="Context_8hpp.html">chi/Context.hpp</a>&quot;</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="GraphModule_8hpp.html">chi/GraphModule.hpp</a>&quot;</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="LLVMVersion_8hpp.html">chi/LLVMVersion.hpp</a>&quot;</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="NodeInstance_8hpp.html">chi/NodeInstance.hpp</a>&quot;</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="NodeType_8hpp.html">chi/NodeType.hpp</a>&quot;</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="Result_8hpp.html">chi/Support/Result.hpp</a>&quot;</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &lt;llvm/IR/DIBuilder.h&gt;</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &lt;llvm/IR/DebugInfo.h&gt;</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &lt;llvm/IR/DerivedTypes.h&gt;</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;</div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#if LLVM_VERSION_LESS_EQUAL(3, 6)</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#include &lt;llvm/IR/Module.h&gt;</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacechi.html">chi</a> {</div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;</div><div class="line"><a name="l00021"></a><span class="lineno"><a class="line" href="structchi_1_1GraphStruct.html#ab9d9a6c278322a563b1d57ec847abe63">   21</a></span>&#160;<a class="code" href="structchi_1_1GraphStruct.html#ab9d9a6c278322a563b1d57ec847abe63">GraphStruct::GraphStruct</a>(<a class="code" href="structchi_1_1GraphModule.html">GraphModule</a>&amp; mod, std::string name)</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;    : mModule{&amp;mod}, mContext{&amp;mod.context()}, mName{std::move(<a class="code" href="structchi_1_1GraphStruct.html#ad25ddcbdf75436b9a0f76720d34257d4">name</a>)} {}</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;</div><div class="line"><a name="l00024"></a><span class="lineno"><a class="line" href="structchi_1_1GraphStruct.html#a464c5edd4ebcb07161c3d05312f1fc33">   24</a></span>&#160;std::vector&lt;NodeInstance*&gt; <a class="code" href="structchi_1_1GraphStruct.html#a464c5edd4ebcb07161c3d05312f1fc33">GraphStruct::setName</a>(std::string newName, <span class="keywordtype">bool</span> updateReferences) {</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;    assert(!newName.empty() &amp;&amp; <span class="stringliteral">&quot;Cannot pass an empty name to GraphStruct::setName&quot;</span>);</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;    <a class="code" href="structchi_1_1GraphStruct.html#a82a1da52a4bf23e1e7fef4d7228603b1">module</a>().<a class="code" href="structchi_1_1ChiModule.html#af3cdb7e3d333fedc74ad862dcc5bca9f">updateLastEditTime</a>();</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;    <span class="keyword">auto</span> oldName = <a class="code" href="structchi_1_1GraphStruct.html#ad25ddcbdf75436b9a0f76720d34257d4">name</a>();</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;    mName        = std::move(newName);</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;    <span class="comment">// find references to update</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;    <span class="keywordflow">if</span> (updateReferences) {</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;        <span class="keyword">auto</span> makeInstances =</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;            <a class="code" href="structchi_1_1GraphStruct.html#a262915d6d2148d7234525e9ccfa5c9d5">context</a>().<a class="code" href="structchi_1_1Context.html#aeec68d24b0031bd29cbc272c8b5fd415">findInstancesOfType</a>(<a class="code" href="structchi_1_1GraphStruct.html#a82a1da52a4bf23e1e7fef4d7228603b1">module</a>().fullNamePath(), <span class="stringliteral">&quot;_make_&quot;</span> + oldName);</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;        <span class="keywordflow">for</span> (<span class="keyword">auto</span> makeInst : makeInstances) {</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;            std::unique_ptr&lt;NodeType&gt; type;</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;            <span class="keyword">auto</span>                      res = <a class="code" href="structchi_1_1GraphStruct.html#a82a1da52a4bf23e1e7fef4d7228603b1">module</a>().<a class="code" href="structchi_1_1GraphModule.html#a133c0595e0bb888f958e9769838f6c0c">nodeTypeFromName</a>(<span class="stringliteral">&quot;_make_&quot;</span> + <a class="code" href="structchi_1_1GraphStruct.html#ad25ddcbdf75436b9a0f76720d34257d4">name</a>(), {}, &amp;type);</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;            <span class="keywordflow">if</span> (!res) { <span class="keywordflow">return</span> {}; }</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;            makeInst-&gt;setType(std::move(type));</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;        }</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;        <span class="keyword">auto</span> breakInstances =</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;            <a class="code" href="structchi_1_1GraphStruct.html#a262915d6d2148d7234525e9ccfa5c9d5">context</a>().<a class="code" href="structchi_1_1Context.html#aeec68d24b0031bd29cbc272c8b5fd415">findInstancesOfType</a>(<a class="code" href="structchi_1_1GraphStruct.html#a82a1da52a4bf23e1e7fef4d7228603b1">module</a>().fullNamePath(), <span class="stringliteral">&quot;_break_&quot;</span> + oldName);</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;        <span class="keywordflow">for</span> (<span class="keyword">auto</span> breakInst : breakInstances) {</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;            std::unique_ptr&lt;NodeType&gt; type;</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;            <span class="keyword">auto</span> res = <a class="code" href="structchi_1_1GraphStruct.html#a82a1da52a4bf23e1e7fef4d7228603b1">module</a>().<a class="code" href="structchi_1_1GraphModule.html#a133c0595e0bb888f958e9769838f6c0c">nodeTypeFromName</a>(<span class="stringliteral">&quot;_break_&quot;</span> + <a class="code" href="structchi_1_1GraphStruct.html#ad25ddcbdf75436b9a0f76720d34257d4">name</a>(), {}, &amp;type);</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;            <span class="keywordflow">if</span> (!res) { <span class="keywordflow">return</span> {}; }</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;            breakInst-&gt;setType(std::move(type));</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;        }</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;        <span class="comment">// append breakInstances to makeInstances so wer can return the updated nodes</span></div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;        makeInstances.reserve(breakInstances.size() + makeInstances.size());</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;        std::copy(breakInstances.begin(), breakInstances.end(), std::back_inserter(makeInstances));</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;        <span class="keywordflow">return</span> makeInstances;</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    }</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    <span class="keywordflow">return</span> {};</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;}</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;</div><div class="line"><a name="l00068"></a><span class="lineno"><a class="line" href="structchi_1_1GraphStruct.html#aba05cdce9627a23da0449801e068d85d">   68</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="structchi_1_1GraphStruct.html#aba05cdce9627a23da0449801e068d85d">GraphStruct::addType</a>(<a class="code" href="structchi_1_1DataType.html">DataType</a> ty, std::string <a class="code" href="structchi_1_1GraphStruct.html#ad25ddcbdf75436b9a0f76720d34257d4">name</a>, <span class="keywordtype">size_t</span> addBefore, <span class="keywordtype">bool</span> updateReferences) {</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    assert(addBefore &lt;= <a class="code" href="structchi_1_1GraphStruct.html#ae1895cfaebac03e21d35ec2a155b3c10">types</a>().size() &amp;&amp; ty.<a class="code" href="structchi_1_1DataType.html#a03384814dde82f88fb097d556cb1da66">valid</a>());</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    <span class="comment">// invalidate the cache</span></div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    <a class="code" href="structchi_1_1GraphStruct.html#a82a1da52a4bf23e1e7fef4d7228603b1">module</a>().<a class="code" href="structchi_1_1ChiModule.html#af3cdb7e3d333fedc74ad862dcc5bca9f">updateLastEditTime</a>();</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;    mTypes.emplace_back(name, ty);</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    <span class="comment">// invalidate the current DataType</span></div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    mDataType = {};</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    <span class="keywordflow">if</span> (updateReferences) { updateNodeReferences(); }</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;}</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;</div><div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="structchi_1_1GraphStruct.html#a89d3ea5e72ed6e7d8380fb82fa5eb521">   82</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="structchi_1_1GraphStruct.html#a89d3ea5e72ed6e7d8380fb82fa5eb521">GraphStruct::modifyType</a>(<span class="keywordtype">size_t</span> <span class="keywordtype">id</span>, <a class="code" href="structchi_1_1DataType.html">DataType</a> newTy, std::string newName,</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;                             <span class="keywordtype">bool</span> updateReferences) {</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    assert(<span class="keywordtype">id</span> &lt; <a class="code" href="structchi_1_1GraphStruct.html#ae1895cfaebac03e21d35ec2a155b3c10">types</a>().size() &amp;&amp; newTy.<a class="code" href="structchi_1_1DataType.html#a03384814dde82f88fb097d556cb1da66">valid</a>() &amp;&amp; !newName.empty());</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    <span class="comment">// invalidate the cache</span></div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    <a class="code" href="structchi_1_1GraphStruct.html#a82a1da52a4bf23e1e7fef4d7228603b1">module</a>().<a class="code" href="structchi_1_1ChiModule.html#af3cdb7e3d333fedc74ad862dcc5bca9f">updateLastEditTime</a>();</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    mTypes[id] = {std::move(newName), std::move(newTy)};</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    <span class="comment">// invalidate the current DataType</span></div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    mDataType = {};</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    <span class="keywordflow">if</span> (updateReferences) { updateNodeReferences(); }</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;}</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;</div><div class="line"><a name="l00097"></a><span class="lineno"><a class="line" href="structchi_1_1GraphStruct.html#a759b0b44c984d7aaa6c2fb32e035264b">   97</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="structchi_1_1GraphStruct.html#a759b0b44c984d7aaa6c2fb32e035264b">GraphStruct::removeType</a>(<span class="keywordtype">size_t</span> <span class="keywordtype">id</span>, <span class="keywordtype">bool</span> updateReferences) {</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    assert(<span class="keywordtype">id</span> &lt; <a class="code" href="structchi_1_1GraphStruct.html#ae1895cfaebac03e21d35ec2a155b3c10">types</a>().size());</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;    <span class="comment">// invalidate the cache</span></div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    <a class="code" href="structchi_1_1GraphStruct.html#a82a1da52a4bf23e1e7fef4d7228603b1">module</a>().<a class="code" href="structchi_1_1ChiModule.html#af3cdb7e3d333fedc74ad862dcc5bca9f">updateLastEditTime</a>();</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    mTypes.erase(mTypes.begin() + id);</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    <span class="comment">// invalidate the current DataType</span></div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    mDataType = {};</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    <span class="keywordflow">if</span> (updateReferences) { updateNodeReferences(); }</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;}</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;</div><div class="line"><a name="l00111"></a><span class="lineno"><a class="line" href="structchi_1_1GraphStruct.html#a27c5062196f73eae3125c0baeb592d00">  111</a></span>&#160;<a class="code" href="structchi_1_1DataType.html">DataType</a> <a class="code" href="structchi_1_1GraphStruct.html#a27c5062196f73eae3125c0baeb592d00">GraphStruct::dataType</a>() {</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;    <span class="comment">// if we have already calculated this, use that</span></div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    <span class="keywordflow">if</span> (mDataType.<a class="code" href="structchi_1_1DataType.html#a03384814dde82f88fb097d556cb1da66">valid</a>()) { <span class="keywordflow">return</span> mDataType; }</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="structchi_1_1GraphStruct.html#ae1895cfaebac03e21d35ec2a155b3c10">types</a>().empty()) { <span class="keywordflow">return</span> {}; }</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;    <span class="comment">// create llvm::Type</span></div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    std::vector&lt;llvm::Type*&gt; llTypes;</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;    llTypes.reserve(<a class="code" href="structchi_1_1GraphStruct.html#ae1895cfaebac03e21d35ec2a155b3c10">types</a>().size());</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;    std::vector&lt;</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;<span class="preprocessor">#if LLVM_VERSION_LESS_EQUAL(3, 5)</span></div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;        llvm::Value*</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;<span class="preprocessor">#else</span></div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;        llvm::Metadata*</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;        &gt;</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;        diTypes;</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;    diTypes.reserve(<a class="code" href="structchi_1_1GraphStruct.html#ae1895cfaebac03e21d35ec2a155b3c10">types</a>().size());</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    <span class="keywordtype">size_t</span> currentOffset = 0;</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;<span class="preprocessor">#if LLVM_VERSION_LESS_EQUAL(3, 6)</span></div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;    <span class="comment">// make a temp module so we can make a DIBuilder</span></div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;    <span class="keyword">auto</span> tmpMod    = std::make_unique&lt;llvm::Module&gt;(<span class="stringliteral">&quot;tmp&quot;</span>, <a class="code" href="structchi_1_1GraphStruct.html#a262915d6d2148d7234525e9ccfa5c9d5">context</a>().<a class="code" href="structchi_1_1Context.html#a8b0dca76be969f24e02a1d286aea377c">llvmContext</a>());</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;    <span class="keyword">auto</span> diBuilder = std::make_unique&lt;llvm::DIBuilder&gt;(*tmpMod);</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;    <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>&amp; type : <a class="code" href="structchi_1_1GraphStruct.html#ae1895cfaebac03e21d35ec2a155b3c10">types</a>()) {</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;        <span class="keyword">auto</span> debugType = type.type.debugType();</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;        llTypes.push_back(type.type.llvmType());</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;        <span class="keyword">auto</span> member =</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;<span class="preprocessor">#if LLVM_VERSION_LESS_EQUAL(3, 6)</span></div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;            diBuilder-&gt;createMemberType(llvm::DIDescriptor(), type.name, llvm::DIFile(), 0,</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;                                        debugType-&gt;getSizeInBits(), 8, currentOffset, 0, *debugType)</div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;#<span class="keywordflow">else</span></div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;            llvm::DIDerivedType::get(<a class="code" href="structchi_1_1GraphStruct.html#a262915d6d2148d7234525e9ccfa5c9d5">context</a>().<a class="code" href="structchi_1_1Context.html#a8b0dca76be969f24e02a1d286aea377c">llvmContext</a>(), llvm::dwarf::DW_TAG_member,</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;<span class="preprocessor">#if LLVM_VERSION_LESS_EQUAL(3, 8)</span></div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;                                     llvm::MDString::get(<a class="code" href="structchi_1_1GraphStruct.html#a262915d6d2148d7234525e9ccfa5c9d5">context</a>().llvmContext(), type.name),</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;<span class="preprocessor">#else</span></div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;                                     type.name,</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;                                     <span class="keyword">nullptr</span>, 0, <span class="keyword">nullptr</span>, debugType, debugType-&gt;getSizeInBits(), 8,</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;                                     currentOffset,</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;<span class="preprocessor">#if LLVM_VERSION_AT_LEAST(5, 0)</span></div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;                                     llvm::None,</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;                                     llvm::DINode::DIFlags{}, <span class="keyword">nullptr</span>)</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;#endif</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;            ;</div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;        diTypes.push_back(member);</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;</div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;        currentOffset += debugType-&gt;getSizeInBits();</div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;    }</div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;    <span class="keyword">auto</span> llType = llvm::StructType::create(llTypes, <a class="code" href="structchi_1_1GraphStruct.html#ad25ddcbdf75436b9a0f76720d34257d4">name</a>());</div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;    <span class="keyword">auto</span> diStructType =</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;<span class="preprocessor">#if LLVM_VERSION_LESS_EQUAL(3, 6)</span></div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;        <span class="keyword">new</span> llvm::DICompositeType(diBuilder-&gt;createStructType(</div><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;            llvm::DIDescriptor(), <a class="code" href="structchi_1_1GraphStruct.html#ad25ddcbdf75436b9a0f76720d34257d4">name</a>(), llvm::DIFile(), 0, currentOffset, 8, 0, llvm::DIType(),</div><div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;            diBuilder-&gt;getOrCreateArray(</div><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;                diTypes)));  <span class="comment">// TODO (#77): yeah this is a memory leak. Fix it.</span></div><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;<span class="preprocessor">#else</span></div><div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;        llvm::DICompositeType::get(</div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;            <a class="code" href="structchi_1_1GraphStruct.html#a262915d6d2148d7234525e9ccfa5c9d5">context</a>().llvmContext(), llvm::dwarf::DW_TAG_structure_type, <a class="code" href="structchi_1_1GraphStruct.html#ad25ddcbdf75436b9a0f76720d34257d4">name</a>(), <span class="keyword">nullptr</span>, 0,</div><div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;            <span class="keyword">nullptr</span>, <span class="keyword">nullptr</span>, currentOffset, 8, 0, llvm::DINode::DIFlags{},</div><div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;            llvm::MDTuple::get(<a class="code" href="structchi_1_1GraphStruct.html#a262915d6d2148d7234525e9ccfa5c9d5">context</a>().llvmContext(), diTypes), 0, <span class="keyword">nullptr</span>, {}, <span class="stringliteral">&quot;&quot;</span>)</div><div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;#endif</div><div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;    ;</div><div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;</div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;    mDataType = <a class="code" href="structchi_1_1DataType.html">DataType</a>(&amp;<a class="code" href="structchi_1_1GraphStruct.html#a82a1da52a4bf23e1e7fef4d7228603b1">module</a>(), <a class="code" href="structchi_1_1GraphStruct.html#ad25ddcbdf75436b9a0f76720d34257d4">name</a>(), llType, diStructType);</div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;</div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;    <span class="keywordflow">return</span> mDataType;</div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;}</div><div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;</div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;<span class="keywordtype">void</span> GraphStruct::updateNodeReferences() {</div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;    <span class="keyword">auto</span> makeInstances = <a class="code" href="structchi_1_1GraphStruct.html#a262915d6d2148d7234525e9ccfa5c9d5">context</a>().<a class="code" href="structchi_1_1Context.html#aeec68d24b0031bd29cbc272c8b5fd415">findInstancesOfType</a>(<a class="code" href="structchi_1_1GraphStruct.html#a82a1da52a4bf23e1e7fef4d7228603b1">module</a>().fullNamePath(), <span class="stringliteral">&quot;_make_&quot;</span> + <a class="code" href="structchi_1_1GraphStruct.html#ad25ddcbdf75436b9a0f76720d34257d4">name</a>());</div><div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;</div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;    <span class="keywordflow">for</span> (<span class="keyword">auto</span> inst : makeInstances) {</div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;        <span class="comment">// make a make type</span></div><div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;        std::unique_ptr&lt;NodeType&gt; ty;</div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;        <span class="keyword">auto</span>                      res = <a class="code" href="structchi_1_1GraphStruct.html#a82a1da52a4bf23e1e7fef4d7228603b1">module</a>().<a class="code" href="structchi_1_1GraphModule.html#a133c0595e0bb888f958e9769838f6c0c">nodeTypeFromName</a>(<span class="stringliteral">&quot;_make_&quot;</span> + <a class="code" href="structchi_1_1GraphStruct.html#ad25ddcbdf75436b9a0f76720d34257d4">name</a>(), {}, &amp;ty);</div><div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;        <span class="keywordflow">if</span> (!res) { <span class="keywordflow">return</span>; }</div><div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;</div><div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;        inst-&gt;setType(std::move(ty));</div><div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;    }</div><div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;</div><div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;    <span class="keyword">auto</span> breakInstances =</div><div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;        <a class="code" href="structchi_1_1GraphStruct.html#a262915d6d2148d7234525e9ccfa5c9d5">context</a>().<a class="code" href="structchi_1_1Context.html#aeec68d24b0031bd29cbc272c8b5fd415">findInstancesOfType</a>(<a class="code" href="structchi_1_1GraphStruct.html#a82a1da52a4bf23e1e7fef4d7228603b1">module</a>().fullNamePath(), <span class="stringliteral">&quot;_break_&quot;</span> + <a class="code" href="structchi_1_1GraphStruct.html#ad25ddcbdf75436b9a0f76720d34257d4">name</a>());</div><div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;    <span class="keywordflow">for</span> (<span class="keyword">auto</span> inst : breakInstances) {</div><div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;        <span class="comment">// make a break type</span></div><div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;        std::unique_ptr&lt;NodeType&gt; ty;</div><div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;        <span class="keyword">auto</span>                      res = <a class="code" href="structchi_1_1GraphStruct.html#a82a1da52a4bf23e1e7fef4d7228603b1">module</a>().<a class="code" href="structchi_1_1GraphModule.html#a133c0595e0bb888f958e9769838f6c0c">nodeTypeFromName</a>(<span class="stringliteral">&quot;_break_&quot;</span> + <a class="code" href="structchi_1_1GraphStruct.html#ad25ddcbdf75436b9a0f76720d34257d4">name</a>(), {}, &amp;ty);</div><div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;        <span class="keywordflow">if</span> (!res) { <span class="keywordflow">return</span>; }</div><div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;</div><div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;        inst-&gt;setType(std::move(ty));</div><div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;    }</div><div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;}</div><div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;</div><div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;}  <span class="comment">// namespace chi</span></div><div class="ttc" id="LLVMVersion_8hpp_html"><div class="ttname"><a href="LLVMVersion_8hpp.html">LLVMVersion.hpp</a></div></div>
<div class="ttc" id="structchi_1_1GraphStruct_html_a464c5edd4ebcb07161c3d05312f1fc33"><div class="ttname"><a href="structchi_1_1GraphStruct.html#a464c5edd4ebcb07161c3d05312f1fc33">chi::GraphStruct::setName</a></div><div class="ttdeci">std::vector&lt; NodeInstance * &gt; setName(std::string newName, bool updateReferences=true)</div><div class="ttdoc">Set the name of the struct, and optionally update all references in the context. </div><div class="ttdef"><b>Definition:</b> <a href="GraphStruct_8cpp_source.html#l00024">GraphStruct.cpp:24</a></div></div>
<div class="ttc" id="structchi_1_1GraphStruct_html_ad25ddcbdf75436b9a0f76720d34257d4"><div class="ttname"><a href="structchi_1_1GraphStruct.html#ad25ddcbdf75436b9a0f76720d34257d4">chi::GraphStruct::name</a></div><div class="ttdeci">const std::string &amp; name() const</div><div class="ttdoc">Get the name of the type. </div><div class="ttdef"><b>Definition:</b> <a href="GraphStruct_8hpp_source.html#l00043">GraphStruct.hpp:43</a></div></div>
<div class="ttc" id="structchi_1_1GraphStruct_html_a89d3ea5e72ed6e7d8380fb82fa5eb521"><div class="ttname"><a href="structchi_1_1GraphStruct.html#a89d3ea5e72ed6e7d8380fb82fa5eb521">chi::GraphStruct::modifyType</a></div><div class="ttdeci">void modifyType(size_t id, DataType newTy, std::string newName, bool updateReferences=true)</div><div class="ttdoc">Change the type and name of a type. </div><div class="ttdef"><b>Definition:</b> <a href="GraphStruct_8cpp_source.html#l00082">GraphStruct.cpp:82</a></div></div>
<div class="ttc" id="Result_8hpp_html"><div class="ttname"><a href="Result_8hpp.html">Result.hpp</a></div><div class="ttdoc">Defines the Result class and related functions. </div></div>
<div class="ttc" id="structchi_1_1GraphStruct_html_a82a1da52a4bf23e1e7fef4d7228603b1"><div class="ttname"><a href="structchi_1_1GraphStruct.html#a82a1da52a4bf23e1e7fef4d7228603b1">chi::GraphStruct::module</a></div><div class="ttdeci">GraphModule &amp; module() const</div><div class="ttdoc">Get the module. </div><div class="ttdef"><b>Definition:</b> <a href="GraphStruct_8hpp_source.html#l00030">GraphStruct.hpp:30</a></div></div>
<div class="ttc" id="structchi_1_1Context_html_aeec68d24b0031bd29cbc272c8b5fd415"><div class="ttname"><a href="structchi_1_1Context.html#aeec68d24b0031bd29cbc272c8b5fd415">chi::Context::findInstancesOfType</a></div><div class="ttdeci">std::vector&lt; NodeInstance * &gt; findInstancesOfType(const boost::filesystem::path &amp;moduleName, boost::string_view typeName) const</div><div class="ttdoc">Find all uses of a node type in all the loaded modules. </div><div class="ttdef"><b>Definition:</b> <a href="Context_8cpp_source.html#l00444">Context.cpp:444</a></div></div>
<div class="ttc" id="structchi_1_1GraphStruct_html_ab9d9a6c278322a563b1d57ec847abe63"><div class="ttname"><a href="structchi_1_1GraphStruct.html#ab9d9a6c278322a563b1d57ec847abe63">chi::GraphStruct::GraphStruct</a></div><div class="ttdeci">GraphStruct(GraphModule &amp;mod, std::string name)</div><div class="ttdoc">GraphType constructor; don&amp;#39;t use this use GraphModule::newStruct. </div><div class="ttdef"><b>Definition:</b> <a href="GraphStruct_8cpp_source.html#l00021">GraphStruct.cpp:21</a></div></div>
<div class="ttc" id="GraphStruct_8hpp_html"><div class="ttname"><a href="GraphStruct_8hpp.html">GraphStruct.hpp</a></div><div class="ttdoc">Define GraphStruct. </div></div>
<div class="ttc" id="structchi_1_1GraphStruct_html_a262915d6d2148d7234525e9ccfa5c9d5"><div class="ttname"><a href="structchi_1_1GraphStruct.html#a262915d6d2148d7234525e9ccfa5c9d5">chi::GraphStruct::context</a></div><div class="ttdeci">Context &amp; context() const</div><div class="ttdoc">Get the context. </div><div class="ttdef"><b>Definition:</b> <a href="GraphStruct_8hpp_source.html#l00026">GraphStruct.hpp:26</a></div></div>
<div class="ttc" id="structchi_1_1GraphStruct_html_a27c5062196f73eae3125c0baeb592d00"><div class="ttname"><a href="structchi_1_1GraphStruct.html#a27c5062196f73eae3125c0baeb592d00">chi::GraphStruct::dataType</a></div><div class="ttdeci">DataType dataType()</div><div class="ttdoc">Get the DataType of the struct. </div><div class="ttdef"><b>Definition:</b> <a href="GraphStruct_8cpp_source.html#l00111">GraphStruct.cpp:111</a></div></div>
<div class="ttc" id="NodeType_8hpp_html"><div class="ttname"><a href="NodeType_8hpp.html">NodeType.hpp</a></div><div class="ttdoc">Defines the NodeType class. </div></div>
<div class="ttc" id="structchi_1_1Context_html_a8b0dca76be969f24e02a1d286aea377c"><div class="ttname"><a href="structchi_1_1Context.html#a8b0dca76be969f24e02a1d286aea377c">chi::Context::llvmContext</a></div><div class="ttdeci">llvm::LLVMContext &amp; llvmContext()</div><div class="ttdoc">Get the LLVMContext </div><div class="ttdef"><b>Definition:</b> <a href="Context_8hpp_source.html#l00173">Context.hpp:173</a></div></div>
<div class="ttc" id="structchi_1_1GraphStruct_html_a759b0b44c984d7aaa6c2fb32e035264b"><div class="ttname"><a href="structchi_1_1GraphStruct.html#a759b0b44c984d7aaa6c2fb32e035264b">chi::GraphStruct::removeType</a></div><div class="ttdeci">void removeType(size_t id, bool updateReferences=true)</div><div class="ttdoc">Remove a type from a struct. </div><div class="ttdef"><b>Definition:</b> <a href="GraphStruct_8cpp_source.html#l00097">GraphStruct.cpp:97</a></div></div>
<div class="ttc" id="structchi_1_1GraphStruct_html_ae1895cfaebac03e21d35ec2a155b3c10"><div class="ttname"><a href="structchi_1_1GraphStruct.html#ae1895cfaebac03e21d35ec2a155b3c10">chi::GraphStruct::types</a></div><div class="ttdeci">const std::vector&lt; NamedDataType &gt; &amp; types() const</div><div class="ttdoc">Get the types the struct contains. </div><div class="ttdef"><b>Definition:</b> <a href="GraphStruct_8hpp_source.html#l00047">GraphStruct.hpp:47</a></div></div>
<div class="ttc" id="structchi_1_1ChiModule_html_af3cdb7e3d333fedc74ad862dcc5bca9f"><div class="ttname"><a href="structchi_1_1ChiModule.html#af3cdb7e3d333fedc74ad862dcc5bca9f">chi::ChiModule::updateLastEditTime</a></div><div class="ttdeci">void updateLastEditTime(std::time_t newLastEditTime=std::time(nullptr))</div><div class="ttdoc">Update the last edit time, signifying that it&amp;#39;s been edited. </div><div class="ttdef"><b>Definition:</b> <a href="ChiModule_8hpp_source.html#l00105">ChiModule.hpp:105</a></div></div>
<div class="ttc" id="structchi_1_1GraphModule_html_a133c0595e0bb888f958e9769838f6c0c"><div class="ttname"><a href="structchi_1_1GraphModule.html#a133c0595e0bb888f958e9769838f6c0c">chi::GraphModule::nodeTypeFromName</a></div><div class="ttdeci">Result nodeTypeFromName(boost::string_view name, const nlohmann::json &amp;jsonData, std::unique_ptr&lt; NodeType &gt; *toFill) override</div><div class="ttdoc">Create a node type that is in the module from the name and json. </div><div class="ttdef"><b>Definition:</b> <a href="GraphModule_8cpp_source.html#l00606">GraphModule.cpp:606</a></div></div>
<div class="ttc" id="structchi_1_1DataType_html_a03384814dde82f88fb097d556cb1da66"><div class="ttname"><a href="structchi_1_1DataType.html#a03384814dde82f88fb097d556cb1da66">chi::DataType::valid</a></div><div class="ttdeci">bool valid() const</div><div class="ttdoc">Check if the DataType is valid (if it&amp;#39;s actually bound to a type and module) </div><div class="ttdef"><b>Definition:</b> <a href="DataType_8hpp_source.html#l00044">DataType.hpp:44</a></div></div>
<div class="ttc" id="structchi_1_1GraphStruct_html_aba05cdce9627a23da0449801e068d85d"><div class="ttname"><a href="structchi_1_1GraphStruct.html#aba05cdce9627a23da0449801e068d85d">chi::GraphStruct::addType</a></div><div class="ttdeci">void addType(DataType ty, std::string name, size_t addBefore, bool updateReferences=true)</div><div class="ttdoc">Add a new type to the struct. </div><div class="ttdef"><b>Definition:</b> <a href="GraphStruct_8cpp_source.html#l00068">GraphStruct.cpp:68</a></div></div>
<div class="ttc" id="structchi_1_1GraphModule_html"><div class="ttname"><a href="structchi_1_1GraphModule.html">chi::GraphModule</a></div><div class="ttdoc">Module that holds graph functions. </div><div class="ttdef"><b>Definition:</b> <a href="GraphModule_8hpp_source.html#l00016">GraphModule.hpp:16</a></div></div>
<div class="ttc" id="GraphModule_8hpp_html"><div class="ttname"><a href="GraphModule_8hpp.html">GraphModule.hpp</a></div><div class="ttdoc">Defines the GraphModule class. </div></div>
<div class="ttc" id="namespacechi_html"><div class="ttname"><a href="namespacechi.html">chi</a></div><div class="ttdoc">The namespace where chigraph lives. </div><div class="ttdef"><b>Definition:</b> <a href="BitcodeParser_8hpp_source.html#l00012">BitcodeParser.hpp:12</a></div></div>
<div class="ttc" id="Context_8hpp_html"><div class="ttname"><a href="Context_8hpp.html">Context.hpp</a></div><div class="ttdoc">Defines the Context class and related functions. </div></div>
<div class="ttc" id="structchi_1_1DataType_html"><div class="ttname"><a href="structchi_1_1DataType.html">chi::DataType</a></div><div class="ttdoc">A type of data Loose wrapper around llvm::Type*, except it knows which ChiModule it&amp;#39;s in and it embed...</div><div class="ttdef"><b>Definition:</b> <a href="DataType_8hpp_source.html#l00017">DataType.hpp:17</a></div></div>
<div class="ttc" id="NodeInstance_8hpp_html"><div class="ttname"><a href="NodeInstance_8hpp.html">NodeInstance.hpp</a></div><div class="ttdoc">Defines the NodeInstance class and related functions. </div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_97aefd0d527b934f1d99a682da8fe6a9.html">lib</a></li><li class="navelem"><a class="el" href="dir_a2d5e495f4b604d04f57d90095a59dd6.html">core</a></li><li class="navelem"><a class="el" href="dir_4c9f1e14e2f6af37c0cac7b6ff4842b3.html">src</a></li><li class="navelem"><a class="el" href="GraphStruct_8cpp.html">GraphStruct.cpp</a></li>
    <li class="footer">Generated on Sat Sep 16 2017 17:41:35 for chigraph by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
